<?php

/**
 * 去除字符串中的所有空格
 * @param $str 字符串或数组
 * @return void
 */
function trimall($str) {
    if(is_array($str)){
        return array_map('trimall', $str);
    }
    $qian=array(" ","　","\t","\n","\r");
    $hou=array("","","","","");
    return str_replace($qian,$hou,$str);    
 }



